package com.qijian.maindata.domain.query;

import com.baomidou.mybatisplus.annotation.TableName;
import com.qijian.common.utils.mybatis.WhereType;
import com.qijian.common.utils.mybatis.WhereTypeEnum;
import lombok.Data;
import lombok.ToString;

@Data
@ToString
@TableName("main_process_order_quota")
public class ProcessOrderQuotaQuery {


    @WhereType(filed = "id")
    private Long id;

    @WhereType(filed="number",type=WhereTypeEnum.LIKE)
    private String number;

    @WhereType(filed="apply_name",type=WhereTypeEnum.LIKE)
    private String applyName;

    @WhereType(func = "exists( select 1 from main_process_order_quota_detail c inner join main_process_order d on c.work_id=d.work_id and c.main_id=main_process_order_quota.id  and d.work_code like concat('%', {1}, '%') )")
    private String workCode;

    @WhereType(func = "exists ( select 1 from main_process_order_quota_detail c " +
            "    inner join main_process_order d on c.work_id=d.work_id and d.is_del=0 " +
            "    inner join main_project p on d.project_id = p.project_id and p.is_del=0" +
            " where c.main_id=main_process_order_quota.id  and p.project_no like concat('%', {1}, '%')  )")
    private String projectNo;

    @WhereType(func = "exists ( select 1 from main_process_order_quota_detail d where d.main_id=main_process_order_quota.id and d.is_del=0 and d.process_name like concat('%', {1}, '%') )")
    private String processName;

    @WhereType(deptTableName = "sys_user", userTableName = "sys_user")
    private Boolean dataScope;

    @WhereType(filed = "project_machine_no",tableName = "main_project",type = WhereTypeEnum.LIKE)
    private String projectMachineNo;


}
